package hexin.bean;
import org.springframework.stereotype.Component;
@Component
public class User {
    private int id;
    private String username;
    private Dept dept;

    public User(){
        System.out.println("###########################");
    }

    //IOC通过构造方法注入

//    public User(int id, String username, Dept dept) {
//        this.id = id;
//        this.username = username;
//        this.dept = dept;
//    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    @Override
    public String toString() {
        return "User [id=" + id + ", username=" + username + ",名称：" + dept + "]";
    }
}
